package me.zhengjie.modules.company.service;

import me.zhengjie.base.PageInfo;
import me.zhengjie.base.CommonService;
import me.zhengjie.modules.company.domain.Company;
import me.zhengjie.modules.company.service.dto.CompanyDto;
import me.zhengjie.modules.company.service.dto.CompanyQueryParam;
import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Set;

/**
* @author TianI
* @date 2022-01-21
*/
public interface CompanyService extends CommonService<Company>  {

    static final String CACHE_KEY = "company";

    /**
    * 查询数据分页
    * @param query 条件
    * @param pageable 分页参数
    * @return PageInfo<CompanyDto>
    */
    PageInfo<CompanyDto> queryAll(CompanyQueryParam query, Pageable pageable);

    /**
    * 查询所有数据不分页
    * @param query 条件参数
    * @return List<CompanyDto>
    */
    List<CompanyDto> queryAll(CompanyQueryParam query);

    Company getById(Long id);
    CompanyDto findById(Long id);

    /**
     * 插入一条新数据。
     */
    int insert(CompanyDto resources);
    int updateById(CompanyDto resources);
    int removeById(Long id);
    int removeByIds(Set<Long> ids);

    Company createImg(MultipartFile file);
    Company createVideo(MultipartFile file);

    /**
    * 导出数据
    * @param all 待导出的数据
    * @param response /
    * @throws IOException /
    */
     void download(List<CompanyDto> all, HttpServletResponse response) throws IOException;

    Company createBanner(MultipartFile file);
}
